@echo off

cmake -B cmake-build-debug .
if not %errorlevel%==0 (
   echo.
   echo Error: cmake configure error.
   exit /b 1
) 
cmake --build cmake-build-debug --target histreamer_st
if not %errorlevel%==0 (
   echo.
   echo Error: compile error.
   exit /b 1
) 
@rem cmake-build-debug\bin\histreamer_st.exe --filter-tags "video_play_fast"
cmake-build-debug\bin\histreamer_st.exe --filter-testcase "Test single player play url video, and finished automatically(std::string(RESOURCE_DIR \"/MP4/9_AVC_1280x720_59.940fps_AAC_128Kbps_2channels.mp4\"))"
if not %errorlevel%==0 (
   echo.
   echo Error: test video play failed.
   exit /b 1
) 
cmake-build-debug\bin\histreamer_st.exe --filter-tags "audio_play_fast"
if not %errorlevel%==0 (
   echo.
   echo Error: test audio play failed.
   exit /b 1
)
cmake-build-debug\bin\histreamer_st.exe --filter-tags "http"
if not %errorlevel%==0 (
   echo.
   echo Error: test http play failed.
   exit /b 1
)
cmake-build-debug\bin\histreamer_st.exe --filter-tags "audio_record_fast"
if not %errorlevel%==0 (
   echo.
   echo Error: test audio record failed.
   exit /b 1
)
@rem cmake-build-debug\bin\histreamer_st.exe --filter-tags "slow"
if not %errorlevel%==0 (
   echo.
   echo Error: run slow tests failed.
   exit /b 1
) 
